package com.zb.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.entity.ZjVideo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/1 0001
 **/
@Data
@ApiModel("视频列表结果封装")
public class VideoListVo {
    @ApiModelProperty(value = "视频ID")
    private Long id;

    @ApiModelProperty(value = "视频名称")
    private String name;

    @ApiModelProperty(value = "所属知识库类型")
    private String knowledgeType;

    @ApiModelProperty(value = "点击数")
    private Integer clickNum;

    @ApiModelProperty(value = "视频图片路径")
    private String image;

    @ApiModelProperty(value = "状态：false-启用，true-禁用")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static VideoListVo beanToVo(ZjVideo video) {
        VideoListVo vo = new VideoListVo();
        BeanUtils.copyProperties(video, vo);
        vo.setStatus(video.getDisabled());
        vo.setCreateTime(video.getGmtCreate());
        vo.setUpdateTime(video.getGmtUpdate());
        return vo;
    }
}
